# -*- coding = utf-8 -*-
# @Time : 2020/8/6 0:11
# @Author : 姚远
# @File : testXwlt.py
# @Software: PyCharm
import xlwt

workbook = xlwt.Workbook(encoding='utf-8')      # 创建wookbook对象
worksheet = workbook.add_sheet('sheet1')        # 创建工作表
# worksheet.write(0, 0, 'hello')      # 写入数据，第一个参数‘行’；第二个参数‘列’；第三个参数是内容
# workbook.save('student.xls')
for i in range(1, 10):
    for j in range(1,i+1):
        worksheet.write(i-1, j-1, '{}*{}={}'.format(i, j, i*j))
workbook.save('student.xls')